<template>
  <div class="hello">
    <el-button @click="login">登录</el-button>
    <el-button @click="VeriCode">获取验证码</el-button>
    <el-button @click="getUser">获取用户角色</el-button>
  </div>
</template>

<script>
export default {
  name: "HelloWorld",
  props: {
    msg: String
  },
  methods: {
    getUser() {
      this.$http.post("/devApi/userRole/", { username: "里斯" });
    },
    VeriCode() {
      this.$http.post("/devApi/login/", { username: "张三" }).then(res => {
        console.log(res.data);
      });
    },
    login() {
      this.$http.post("/devApi/getSms/", { username: "大王" }).then(res => {
        console.log(res);
      });
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
